/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package objectoriented.polymorphism;

import objectoriented.abstraction.Animal;

/**
 *
 * @author peng
 */
public class AnimalIdentifier {
    
    public static void main(String args[])
    {
        //animal reference 
        Animal animalRef;
        
        //constructing objects deer, wolf and lion
        Deer deer = new Deer("Sophie");
        Wolf wolf = new Wolf("Bran");
        Lion lion = new Lion("Leon");
        
        //assign each animal to animalRef,
        //then calls the describe method.
        animalRef = deer; animalRef.describe();
        animalRef = wolf; animalRef.describe();
        animalRef = lion; animalRef.describe();
        
        return;
    }
    
}
